angular.module('meMoreOpinionaireServices', [])

  .factory('MoreOpinionaire', function ($resource, $rootScope, ENV, Storage) {


    //设置访问接口路径
    var APIUrl = ENV.api;

    //访问获取用户信息的接口
    var addAdviceResource = $resource(APIUrl + "meMore/addAdvice.do");


    var addOpinionJson;

    return{

      //提交意见
      addOpinion : function(advice){
        addAdviceResource.save(
          advice,
          function (data){
            addOpinionJson = data;
            $rootScope.$broadcast('Me.addOpinion');
          }
        );
      },

      getAddOpinionJson : function (){
        return addOpinionJson;
      }
    }

  });
